package CryptoPrim;

import ArithmeticObjects.*;
import ArithUtils.*;

/**
 * A class which represents Randomizer (rm)
 * 
 * @author Itamar Carmel, amirzell
 *
 */
public class Randomizer {

	// suppose r = (r1,...,rw)
	private Array<BTField<BigNumber>.BTElement> elmArr; // r
	
	/**
	 * Constructor of RM which initiate the array 'r'.
	 */
	public Randomizer(){
		this.elmArr = new Array<BTField<BigNumber>.BTElement>();
	}
	
	/**
	 * Constructor for RM from an element array (r).
	 * 
	 * @param elmArr
	 */
	public Randomizer(Array<BTField<BigNumber>.BTElement> elmArr){
		this.elmArr = elmArr;
	}

	/**
	 * Getter for the i'th element.
	 * 
	 * @param i - index
	 * @return r[i]
	 */
	public BTField<BigNumber>.BTElement get(int i) {
		return this.elmArr.get(new BigNumber (i));
	}

	/**
	 * Adds an element to r[length].
	 * 
	 * @param elm
	 */
	public void add(BTField<BigNumber>.BTElement elm) {
		this.elmArr.add(elm);
	}
	
	/**
	 * Getter for array of elements - r.
	 * 
	 * @return r
	 */
	public Array<BTField<BigNumber>.BTElement> getArr() {
		return this.elmArr;
	}
}
